package march.test_3_7;

import com.sun.xml.internal.org.jvnet.fastinfoset.EncodingAlgorithmIndexes;

import java.util.Scanner;

public class TestMain3 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNextInt()) {
            int n = scanner.nextInt();
            int a = scanner.nextInt();
            int[] arr = new int[n];
            for(int i = 0; i < arr.length; i++) {
                arr[i] = scanner.nextInt();
            }
            System.out.println(result(arr,a));
        }
    }
    public static int result(int[] arr,int a) {
        for(int i = 0; i < arr.length; i++) {
            if(arr[i] <= a) {
                a += arr[i];
            } else {
                a += common(arr[i],a);
            }
        }
        return a;
    }
    public static int common(int tmp, int a) {
        for(int i = a; i > 0; i--) {
            if(tmp % i == 0 && a % i == 0) {
                return i;
            }
        }
        return -1;
    }
}
